// heterogeneous vector
#include <vector>
#include <tuple>
#include <utility>
#include <type_traits>
#include "meta/utils.hh"

template <class ...ELEMENTS>
struct hevec
{
	using value_type = std::tuple<std::vector<std::decay_t<ELEMENTS>>...>;

	template <class T, class ...TS>
	void emplace_back(TS&&... xs)
	{
		get<T>().emplace_back(std::forward<TS>(xs)...);
	}

	template <class T>
	void push_back(T&& x)
	{
		get<T>().push_back(std::forward<T>(x));
	}

private:
	value_type value;

	template <class T>
	auto& get() { return std::get<meta::utils::index_of<T, ELEMENTS...>>(value); }
};

#include <iostream>
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
int main()
{
	hevec<double, int> hv;
	hv.push_back(1);
	hv.push_back(1.2);
	cerr << meta::utils::index_of<int, double, int> << endl;
}

